package com.after.saas.file.utils;

import java.util.Arrays;
import java.util.Objects;

/**
 * @Classname CalculateUtil
 * @Description TODO
 * @auth after
 * @since 2022/4/9 15:52
 */
public class CalculateUtil {

    public static Integer add(Integer... integers) {
        return Arrays.stream(integers).filter(Objects::nonNull).reduce(0, Integer::sum);
    }

    public static void main(String[] args) {
        Integer integer = 1;
        Integer first = 2;
        Integer second = 3;
        Integer add = add(integer, first,second);
        System.out.println(add);
    }
}
